package com.scommunity.service.impl;

import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.scommunity.domain.Role;
import com.scommunity.mapper.RoleMapper;
import com.scommunity.service.IRoleService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.cache.annotation.Cacheable;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class RoleServiceImpl extends ServiceImpl<RoleMapper, Role> implements IRoleService {
    @Autowired
    private RoleMapper roleMapper;

    @Override
    public List<Role> getAllByEmpId(Long empId) {
        return roleMapper.getAllByEmpId(empId);
    }

    @Override
    public List<Role> getAll() {
        return roleMapper.getAll();
    }

    @Cacheable(value = "roles")
    @Override
    public List<Role> getAllRoles() {
        return roleMapper.getAllRoles();
    }

}
